

package com.hazelcast.internal.management.operation;

import com.hazelcast.spi.impl.NodeEngine;
import com.hazelcast.spi.impl.operationservice.AbstractLocalOperation;
import com.hazelcast.wan.impl.WanReplicationService;

/**
 * Checking consistency of the given map for the given wan replication
 * schema and publisher
 */
public class WanCheckConsistencyOperation extends AbstractLocalOperation {
    private String schemeName;
    private String publisherName;
    private String mapName;

    public WanCheckConsistencyOperation(String schemeName, String publisherName, String mapName) {
        this.schemeName = schemeName;
        this.publisherName = publisherName;
        this.mapName = mapName;
    }

    @Override
    public void run() throws Exception {
        NodeEngine nodeEngine = getNodeEngine();
        WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService();
        wanReplicationService.consistencyCheck(schemeName, publisherName, mapName);
    }
}
